#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
typedef struct
{
    char a;
    short b;
    char c;
    int d;
    char e[1];
} mychkstct;
#define chkStrData "123456"

#define myOffset(structType, numberName) ((long)(&((structType *)0)->numberName))

int main(int argc, char **argv)
{
    //求结构体变量偏移地址。
    printf("[%s,%s,%d]offsetof=%d\n", __FILE__, __func__, __LINE__, (int)offsetof(mychkstct, e));
    printf("[%s,%s,%d]myoffsetof=%d\n", __FILE__, __func__, __LINE__, (int)myOffset(mychkstct, e));
    return 1;
}



